package com.app.modules.job.service.impl;

import com.app.common.utils.PageUtils;
import com.app.common.utils.Query;
import com.app.modules.job.dao.ScheduleJobLogDao;
import com.app.modules.job.entity.ScheduleJobLogEntity;
import com.app.modules.job.service.ScheduleJobLogService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author : [zhuhj]
 * @version : [v1.0]
 * @className : ScheduleJobLogServiceImpl
 * @description : [描述说明该类的功能]
 * @createTime : [2025/8/17 18:44]
 * @updateUser : [zhuhj]
 * @updateTime : [2025/8/17 18:44]
 * @updateRemark : [描述说明本次修改内容]
 */
@Service("scheduleJobLogService")
public class ScheduleJobLogServiceImpl extends ServiceImpl<ScheduleJobLogDao, ScheduleJobLogEntity> implements ScheduleJobLogService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String jobId = (String)params.get("jobId");

        IPage<ScheduleJobLogEntity> page = this.page(
                new Query<ScheduleJobLogEntity>().getPage(params),
                new QueryWrapper<ScheduleJobLogEntity>().like(StringUtils.isNotBlank(jobId),"job_id", jobId)
        );

        return new PageUtils(page);
    }

}